// 库存管理的api接口
import { $post, $get } from '@/utils/request';
import {
  flowQueryParam,
  returnQueryParam,
  byItemParam,
  DeliverySearchParam,
  PalletDataParam,
  SingleSearchParam,
  OutInFlowParam,
  ERPOutSearchParam,
  QuerySortInfoParam,
  QuerySendToolParam,
  DeliveryQueryParam,
} from './types';

// 入库查询
export function queryInventoryIn(data: flowQueryParam) {
  return $post('/inBillQuery/ParamsByInBillQuery', data);
}

// 退库查询
export function returnInventory(data: returnQueryParam) {
  return $post('/ReturnApplyQuery/ParamsByReturnQuery', data);
}

// 台账查询
export function byItem(data: byItemParam) {
  return $post('/WmsItemInventorySearch/searchParamsByItem', data);
}

// 台账查询-查看缓存箱
export function queryItemPallet(data: any) {
  return $post('/WmsItemInventorySearch/queryItemPallet', data);
}

// 交接查询
export function deliverySearch(data: DeliverySearchParam) {
  return $post('/DeliveryPlanQuery/ParamsByDeliveryQuery', data);
}

// 重推移交
export function sendRecallDeliveryPlan(data: any) {
  return $post('/TestCallWz/reCallChangeTransfer', data);
}

// 重推台账
export function sendRecallInventory(data: any) {
  return $post('/TestCallWz/reCallToErp', data);
}

// 重推协调
export function sendReCallCoordinate(data: any) {
  return $post('/TestCallWz/reCallCoordinate', data);
}

// 重推扫码退回
export function sendRecallScanBack(data: any) {
  return $post('/TestCallWz/reCallScanBack', data);
}

// 修改质量编号
export function sendChangedQuantityCode(data: any) {
  return $post('/DeliveryPlanQuery/updateQualityCode', data);
}

// 修改交接单状态
export function sendUpdateDeliveryStatus(data: any) {
  return $post('/DeliveryPlanQuery/updatedeliveryStatus', data);
}

// 推送移交
export function sendRecallTabDevlieryPlan(data: any) {
  return $post('/TestCallWz/reCallChangeTransfer', data);
}

// 推送台账
export function sendRecallTabInventory(data: any) {
  return $post('/TestCallWz/reCallToErp', data);
}

// 推送出库
export function sendRecallTabInvOut(data: any) {
  return $get('/TestCallWz/makeMaterialCheck', data);
}

// 推送占用
export function sendRecallTabAllot(data: any) {
  return $get('/TestCallWz/sendOccupyInfo', data);
}

// 交接查询作废
export function cancelTabAllot(data: any) {
  return $post('/DeliveryPlanQuery/revokedeliveryStatus', data);
}

// 托盘信息查询
export function palletDataSearch(data: PalletDataParam) {
  return $post('/PalletCode/palletCodeQuery', data);
}

// 库存架次查询
export function sendSingleSearch(data: SingleSearchParam) {
  return $post('/WmsItemInventorySearch/searchSingleQty', data);
}

// 出入口流水查询
export function outInFlowSearch(data: OutInFlowParam) {
  return $post('/wmsItemTransaction/outInFlowQuery', data);
}

// ERP出库叫箱
export function erpOutWorkSearch(data: ERPOutSearchParam) {
  return $post('/erpOutBill/erpOutWorkbinQuery', data);
}

// 配套信息-配套明细
export function querySortInfoSearch(data: QuerySortInfoParam) {
  return $post('/sortDeliveryRest/querySortInfo', data);
}

// 配套信息-配送托盘
export function querySendToolSearch(data: QuerySendToolParam) {
  return $post('/sortDeliveryRest/querySendTool', data);
}

// ERP出库叫箱-缓存箱出库
export function ERPBoxOut(data: any) {
  return $post('/erpOutBill/outWorkbin', data);
}

// ERP出库叫箱-保存
export function saveWorkbin(data: any) {
  return $post('/erpOutBill/saveWorkbin', data);
}

// ERP出库叫箱-缓存箱回库
export function inWorkbin(data: any) {
  return $post('/erpOutBill/inWorkbin', data);
}

// 配送查询
export function deliveryQuerySearch(data: DeliveryQueryParam) {
  return $post('/DeliveryPlanQuery/DeliveryQuery', data);
}

// 配送查询-修改备注
export function updateRemark(data: any) {
  return $post('/DeliveryPlanQuery/updateRemark', data);
}

// 配送查询-撤销未移交
export function cancelUnDelivery(data: any) {
  return $post('/DeliveryPlanQuery/cancelUnDelivery', data);
}

// 配送查询-重新推送
export function reSendPlane(data: any) {
  return $post('/DeliveryPlanQuery/reSend', data);
}

// 配送查询-重新推送
export function reSendRemarkPlane(data: any) {
  return $post('/DeliveryPlanQuery/reSendRemark', data);
}

// 配送查询-重新推送
export function cancelDeliveryPlane(data: any) {
  return $post('/DeliveryPlanQuery/cancelDelivery', data);
}

// 实时库存汇总
export function PageInventoryDetails(data: any) {
  return $post('/InventoryDetailsController/PageInventoryDetails', data);
}
